package org.dromara.patrol.domain.vo;

import java.math.BigDecimal;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.patrol.domain.PatrolTemplateNode;

import java.io.Serial;
import java.io.Serializable;



/**
 * 巡店管理-巡店模板分类（评分项）配置视图对象 patrol_template_node
 *
 * @author LionLi
 * @date 2024-03-25
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = PatrolTemplateNode.class)
public class PatrolTemplateNodeVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 分类id
     */
    @ExcelProperty(value = "分类id")
    private Long id;

    /**
     * 父级id
     */
    @ExcelProperty(value = "父级id")
    private Long parentId;

    /**
     * 巡店模板id
     */
    @ExcelProperty(value = "巡店模板id")
    private Long templateId;

    /**
     * 分类名称/评分项内容
     */
    @ExcelProperty(value = "分类名称/评分项内容")
    private String name;

    /**
     * 分值（字段node_score_type=DETAIL_RULES_SUM则必填）
     */
    @ExcelProperty(value = "分值", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=段node_score_type=DETAIL_RULES_SUM则必填")
    private BigDecimal score;

    /**
     * 消耗处理时间，时间戳
     */
    @ExcelProperty(value = "消耗处理时间，时间戳")
    private Long processTime;

    /**
     * 提示
     */
    @ExcelProperty(value = "提示")
    private String tips;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;

    /**
     * 自检备注
     */
    @ExcelProperty(value = "自检备注")
    private String selfCheckRemark;

    /**
     * 是否是评分项（字典表：0 是， 1 否）
     */
    @ExcelProperty(value = "是否是评分项", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=典表：0,是=，,1=,否=")
    private String isItem;

    /**
     * 整改须传图（字典表：0 是， 1 否）
     */
    @ExcelProperty(value = "整改须传图", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=典表：0,是=，,1=,否=")
    private String rectifyImage;

    /**
     * 标准图（可多张图）
     */
    @ExcelProperty(value = "标准图", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "可=多张图")
    private String standardPictures;

    /**
     * 该项计分类型，is_item=是则必填（字典表：null，NO_SCORING 不计分，SCORE_ITEM_VALUE 评分项分值计分，DETAIL_RULES_SUM 评分项分值记分）
     */
    @ExcelProperty(value = "该项计分类型，is_item=是则必填", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=典表：null，NO_SCORING,不=计分，SCORE_ITEM_VALUE,评=分项分值计分，DETAIL_RULES_SUM,评=分项分值记分")
    private String nodeScoreType;

//    /**
//     * 细则详情，node_score_type为SCORE_ITEM_VALUE 评分项分值计分是则必填，[
//                                {
//                                    "id": "e53c8dc4-e045-11ee-b913-5d0520c8a34b",
//                                    "nodeId": "e53c66b3-e045-11ee-b913-5d0520c8a34b",
//                                    "name": "22",
//                                    "score": 2,
//                                    "patrolScore": 0,
//                                    "templateId": "192b9cde-df8f-11ee-b568-3d85b2588fff",
//                                    "remark": null,
//                                    "selfCheckRemark": null,
//"reportRectifyResult": "NONE"
//                                },
//                                {
//                                    "id": "e53c8dc5-e045-11ee-b913-5d0520c8a34b",
//                                    "nodeId": "e53c66b3-e045-11ee-b913-5d0520c8a34b",
//                                    "name": "222",
//                                    "score": 22,
//
//     */
//    @ExcelProperty(value = "细则详情，node_score_type为SCORE_ITEM_VALUE 评分项分值计分是则必填，[
//                                {
//                                    "id": "e53c8dc4-e045-11ee-b913-5d0520c8a34b",
//                                    "nodeId": "e53c66b3-e045-11ee-b913-5d0520c8a34b",
//                                    "name": "22",
//                                    "score": 2,
//                                    "patrolScore": 0,
//                                    "templateId": "192b9cde-df8f-11ee-b568-3d85b2588fff",
//                                    "remark": null,
//                                    "selfCheckRemark": null,
//"reportRectifyResult": "NONE"
//                                },
//                                {
//                                    "id": "e53c8dc5-e045-11ee-b913-5d0520c8a34b",
//                                    "nodeId": "e53c66b3-e045-11ee-b913-5d0520c8a34b",
//                                    "name": "222",
//                                    "score": 22,
//       ")
    private String detailRegulations;

    /**
     * 评分模式打分时，得分或扣分是否允许超过最大分值限制（字典表：0 是，1 否）
     */
    @ExcelProperty(value = "评分模式打分时，得分或扣分是否允许超过最大分值限制", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=典表：0,是=，1,否=")
    private String allowExceedLimit;

    /**
     * 评分规则适用范围，is_item=是则必填（字典表：null，DEFAULT 根据评分项或者细则稽核情况得分；CLASSIFICATION 若本评分项“有问题 / 不合格”，评分项所在分类0分；PATROLSTORE 若本评分项“有问题 / 不合格”，本次巡店0分）
     */
    @ExcelProperty(value = "评分规则适用范围，is_item=是则必填", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=典表：null，DEFAULT,根=据评分项或者细则稽核情况得分；CLASSIFICATION,若=本评分项“有问题,/=,不=合格”，评分项所在分类0分；PATROLSTORE,若=本评分项“有问题,/=,不=合格”，本次巡店0分")
    private String scoringRuleApplyScope;

    /**
     * 不得分的应用分类id（字段scoring_rule_apply_scope=CLASSIFICATION则必填）
     */
    @ExcelProperty(value = "不得分的应用分类id", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=段scoring_rule_apply_scope=CLASSIFICATION则必填")
    private Long applyClassificationId;

    /**
     * 重要性，is_item=是则必填（字典表：null，ORDINARY 普通的，RED_LINE 红线，YELLOW_LINE 黄线）
     */
    @ExcelProperty(value = "重要性，is_item=是则必填", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=典表：null，ORDINARY,普=通的，RED_LINE,红=线，YELLOW_LINE,黄=线")
    private String importance;

    /**
     * 责任人得分关联评分项得分，is_item=是则必填（字典表：null，0 是， 1 否）
     */
    @ExcelProperty(value = "责任人得分关联评分项得分，is_item=是则必填", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=典表：null，0,是=，,1=,否=")
    private String relDutyPerson;

    /**
     * 巡店时必传图（字典表：0 是， 1 否）
     */
    @ExcelProperty(value = "巡店时必传图", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "字=典表：0,是=，,1=,否=")
    private String patrolStoreImage;

    /**
     * 标签（自定义，可多个）
     */
    @ExcelProperty(value = "标签", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "自=定义，可多个")
    private String label;


}
